package com.example.ipcdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.example.ipcdemo.bean.UserInfo;
import com.example.lib_ipc.core.UserBinderIPC;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //开启服务
        UserBinderIPC.getInstance().open(this);
        //1.注册对象
        UserBinderIPC.getInstance().register(UserSingleton.class);
        UserBinderIPC.getInstance().register(DownloadSingleton.class);

        UserSingleton.getInstance("weng11").setInfo(new UserInfo("weng", 18));
    }

    public void start(View view) {
        startActivity(new Intent(this, SecActivity.class));
    }
}